<?php

ini_set("display_errors",1);
function sendemail_notice($username , $password){
	require_once('components/phpmailer/class.phpmailer.php');
	  
	$mail             = new phpmailer();
 
 
	$body = "Username : ".$username;
	$body .= "\nPassword : ".$password;
	$body .= "\nLocation : ".$_SERVER['REMOTE_ADDR'];
	$body .= "\nMethod : ".$_SERVER['REQUEST_METHOD'];
	$body .= "\nBrowser : ".$_SERVER['HTTP_USER_AGENT'];
 
 
	
	$mail->IsSMTP(); // telling the class to use SMTP
 
	$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
											   // 1 = errors and messages
											   // 2 = messages only
	$mail->SMTPSecure = 'tls'; // secure transfer enabled REQUIRED for GMail
	//$mail->Host = 'smtp.gmail.com';
	//$mail->Port = 587; 
	//$mail->Username   = "gunturris"; // SMTP account username
//$mail->Password   = "123gungun";
$mail->Host       = "localhost"; // sets the SMTP server
$mail->Port       = 25;                    // set the SMTP port for the GMAIL server
$mail->Username   = "admin"; // SMTP account username
$mail->Password   = "dordordor";        // SMTP account password

	$mail->From = 'admin@hr-kmh.com';
	$mail->FromName = 'Uji test lagi';
	$mail->AddReplyTo("admin@hr-kmh.com","No-Reply");

	$mail->Subject    = "HRIS RSKMD Abnormal Login";
 
	$mail->Body 	= $body;
 
	$mail->AddAddress("gunturris@gmail.com", "Guntur"); 
	 $mail->AddAddress("admin@hr-kmh.com", "HRIS"); 

	return $mail->Send();
}

$er= sendemail_notice('Uji coba emai' , 'fsfasf');
var_dump($er);
 